﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Detai.Admin.ViewModels;
using Detai.Admin.Models;
using Detai.Lib.Common;
using Detai.Admin.Components;

namespace Detai.Admin.Controllers
{
	[HandleError]
    [Authorize()]
	public class HomeController : Controller
	{
        DetaiDataContext eDataContext = new DetaiDataContext();
        public ActionResult Index()
		{
            var temp = new BaseAuthentication();
                var currentUser = temp.CurrentUser;
                if (currentUser != null && (currentUser.LoaiTK == 1 || currentUser.LoaiTK == 2))
                {
                    HomeViewModels h = new HomeViewModels();

                    return View(h);
                }
                else {
                    return RedirectToAction("LogOff", "Account");
                }
		}

		public ActionResult About()
		{ 
            
			return View();
		}
	}
}
